package com.example.demo.command;

import jakarta.annotation.Resource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.shell.standard.ShellComponent;
import org.springframework.shell.standard.ShellMethod;

@ShellComponent
public class ResetPasswordCommand {

    @Resource
    JdbcTemplate jdbcTemplate;

    @ShellMethod(key = "resetPassword")
    public String resetPassword(String username, String password) {
        jdbcTemplate.update("UPDATE manage_account SET password = ? WHERE username = ?", password, username);
        return "OK";
    }

}
